﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ctlContactFaces.ascx.cs" Inherits="Ctl_ctlContactFaces" %>
 

<%@ Register src="ctlContactFace.ascx" tagname="ctlContactFace" tagprefix="uc1" %>


<asp:UpdatePanel ID ="updContactFaces"  runat ="server"  >
<ContentTemplate >
<asp:Panel runat="server" ID="HeadBox" Visible=<%#ShowHead %> Width  =100% >
<table style ="width :100%">
    <tr id=Tr1  runat ="server"   style ="height:15px" >
                    <td class ="grd_td_head ">
                        <table width ="100%" cellpadding ="2px" cellspacing ="0">
                            <tr >
                                <td   style ="width :50px" >
                                    <asp:UpdateProgress ID="UpdateProgress2" runat="server"  >
                                    <ProgressTemplate >
                                    <asp:Image ID=Image11 ImageUrl="~/images/loadinfo.net.gif" runat="server" />
                                    </ProgressTemplate>
                                    </asp:UpdateProgress>
                                </td>
                                <td  style ="width :30%" >
                                    <asp:LinkButton ID=GID runat="server" OnClick ="lvSort" CommandArgument ="FullName" >Фамилия Имя Отчество</asp:LinkButton>
                                    <asp:Label ID=Label1 runat="server"  CssClass =<%# GetHeadCss("FullName") %>   Text="&nbsp&nbsp&nbsp"></asp:Label>                
                                </td>
                                <td style ="width :20%"  >
                                    Организация
                                    <%--<asp:LinkButton ID=LinkButton1 runat="server" OnClick ="lvSort" CommandArgument ="Position" >Организация</asp:LinkButton>
                                    <asp:Label ID=Label2 runat="server"  CssClass =<%# GetHeadCss("Position") %>   Text="&nbsp&nbsp&nbsp"></asp:Label>                --%>
                                </td>
                                <td  >
                                    <asp:LinkButton ID=LinkButton2 runat="server" OnClick ="lvSort" CommandArgument ="ContactsAsString" >Контактная информация</asp:LinkButton>
                                    <asp:Label ID=Label3 runat="server"  CssClass =<%# GetHeadCss("ContactsAsString") %>   Text="&nbsp&nbsp&nbsp"></asp:Label>                
                                </td>
                                <td style="width:30px; text-align :right"   >
                                    &nbsp
                                </td>
                            </tr>
                        </table>
                    </td>
     </tr>
    </table> 
  </asp:Panel> 

<table cellpadding ="0" cellspacing ="0" width ="100%" >
                 <asp:ListView ID="lvContactFaces" runat="server" onitemcommand="ItemCommand" 
                        onitemediting="ItemEditing" onitemupdating="ItemUpdating" 
                     onpagepropertieschanged="lvContactFaces_PagePropertiesChanged" >                 
                 <LayoutTemplate >                    
                    <tr runat="server" id="itemPlaceholder" ></tr>                                                
                 </LayoutTemplate>                 
                 <ItemTemplate >
                    <tr id=Tr1  runat ="server"   style ="height:15px" >
                    <td class ="grd_td_item" onmouseover ="GrdItemOnMouseOver(this);" onmouseout ="GrdItemOnMouseOut(this);">                  
                          <table width ="100%" cellpadding ="2px" cellspacing ="0">            
                            <tr >
                            <td   style ="width :50px" >                                                    
                                <asp:ImageButton ID=btnEditWorker CommandName ="Edit" ImageUrl ="~/images/grd_plus.gif" runat="server" />
                            </td>                      
                            <td  style ="width :30%" >                
                                <%# (string)Eval ("FullName") %>
                            </td>
                            <td style ="width :20%"  >                    
                                <%# GetCompanyName((AgencyEntityLib.BaseEntity.ContactFace)Container.DataItem)%>
                            </td>                        
                            <td  >
                             <%# (string)Eval("ContactsAsString")%>                                
                            </td>            
                            <td style="width:30px; text-align :right"   >
                                <asp:ImageButton ID=btnWorkerRemove OnClientClick ="OnDeleteClick();" ImageUrl ="~/images/trash.png" CommandArgument =<%# (string) Eval("ID") %> OnClick ="BntRemoveWorker_Click" runat="server" />
                            </td>            
                            </tr> 
                          </table>                                              
                    </td>
                    </tr>
                 </ItemTemplate>    
                 <EditItemTemplate >
                    <tr id=Tr1  runat ="server"   style ="height:15px" >
                    <td class ="grd_td_item"> 
                    <uc1:ctlContactFace FaceID='<%# (string)Eval("ID") %>' ID="ctlContactFace2" runat="server" />                     
                    </td> 
                    </tr> 
                 </EditItemTemplate >
                 <EmptyDataTemplate >
                 <tr>
                 <td style ="text-align :center ">
                    Контактных лиц нет                    
                 </td> 
                 </tr>
                 </EmptyDataTemplate>
                </asp:ListView>
 </table>
 
<asp:DataPager runat="server" ID="DataPager"  EnableViewState ="true"  
    PagedControlID = "lvContactFaces" PageSize=<%# PageSize %> Visible=<%# PagerVisible %> >
        <Fields>
          <asp:NumericPagerField  ButtonType ="Link"                       
              ButtonCount="5"
               PreviousPageText="<--"
               NextPageText="-->" />
               
               <asp:NextPreviousPagerField ButtonType="Link"
                ShowFirstPageButton="true"
                ShowPreviousPageButton="true"
                ShowLastPageButton="true" 
                ShowNextPageButton ="true"/>
        </Fields>
    </asp:DataPager>
<asp:HiddenField ID="hfSel" runat="server" />
<asp:HiddenField ID="hfPref" runat="server" />
<asp:HiddenField ID="hfPageSize" runat="server" Value="5" />
</ContentTemplate> 
</asp:UpdatePanel> 



